<template>
    <el-container v-if="$route.name != 'video_view'">
        <el-header>
            <NavBar></NavBar>
        </el-header>
        <el-container>
            <el-aside width="200px" v-if="$store.state.user.is_login">
                <el-menu router default-active="/admin/goods" style="height: 100%;">
                    <el-menu-item index="/admin/goods">订单管理</el-menu-item>
                    <el-menu-item index="/admin/video">视频管理</el-menu-item>
                    <el-menu-item index="/admin/station" v-if="$store.state.user.role == 'ROLE_ADMIN'">工位管理</el-menu-item>
                    <el-menu-item index="/admin/camera" v-if="$store.state.user.role == 'ROLE_ADMIN'">录像机管理</el-menu-item>
                    <el-menu-item index="/admin/user/" v-if="$store.state.user.role == 'ROLE_ADMIN'">用户管理</el-menu-item>
                    <el-menu-item index="/admin/group" v-if="$store.state.user.role == 'ROLE_ADMIN'">组别管理</el-menu-item>
                    <el-menu-item index="/admin/license" v-if="$store.state.user.role == 'ROLE_ADMIN'">系统设置</el-menu-item>
                    <el-sub-menu v-if="$store.state.user.role == 'ROLE_ADMIN' && $store.state.user.company.id == 1">
                        <template #title>管理员选项</template>
                        <el-menu-item index="/admin/company">公司管理</el-menu-item>
                        <el-menu-item index="/admin/vip">会员管理</el-menu-item>
                        <el-menu-item index="/admin/device">工控机管理</el-menu-item>
                    </el-sub-menu>
                </el-menu>
            </el-aside>
            <el-main>
                <router-view></router-view>
            </el-main>
        </el-container>
    </el-container>
    <el-container v-else>
        <el-main><router-view></router-view></el-main>
    </el-container>
</template>

<script>
import "bootstrap/dist/css/bootstrap.min.css"
import "bootstrap/dist/js/bootstrap"
import NavBar from '@/components/NarBar.vue'
export default {
    components: {
        NavBar
    },
}
</script>
<style scoped>
.el-header {
    padding: 0;
}
</style>
